#!/usr/bin/python

# BigData course project
# Generates n copies an ID matrix of arbitrary dimension (sparse version)

import sys

def gen_id_matrix(dim, n, fname):
    f = open(fname,"w")
    for k in xrange(0,n):
        for i in xrange(0,dim):
            f.write("%d %2.6f\n" % (i,1.0)) 
    f.close()
    return

# main
ec = 0
if len(sys.argv) != 4:
    print("\nUsage: %s <dim> <n> <fname>\n" % (sys.argv[0]))
    ec = 1
else:
    gen_id_matrix(int(sys.argv[1]), int(sys.argv[2]), sys.argv[3])
sys.exit(ec)
